package com.central.scheduler.common.task;

import com.central.scheduler.common.enums.TaskTimeoutStrategy;
import com.central.scheduler.common.enums.TimeoutFlag;
import lombok.Getter;
import lombok.Setter;

/**
 * @author Tindy
 * @date 2021/11/5
 * @describe
 * task timeout parameter
 */
@Getter
@Setter
public class TaskTimeoutParameter {

    private TimeoutFlag flag;
    /**
     * task timeout strategy
     */
    private TaskTimeoutStrategy strategy;
    /**
     * task timeout interval
     */
    private int interval;

    public TaskTimeoutParameter() {
    }

    public TaskTimeoutParameter(TimeoutFlag flag, TaskTimeoutStrategy strategy, int interval) {
        this.flag = flag;
        this.strategy = strategy;
        this.interval = interval;
    }

    @Override
    public String toString() {
        return "TaskTimeoutParameter{" +
                "flag=" + flag +
                ", strategy=" + strategy +
                ", interval=" + interval +
                '}';
    }
}
